###
### Makefile for GNU Interactive Tools
###

###
### Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
###
### This program is  free software; you can  redistribute it and/or modify
### it under the terms  of the GNU General Public  License as published by
### the  Free Software Foundation; either version  2,  or (at your option)
### any later version.
### 
### This program is distributed  in the hope that  it will be  useful, but
### WITHOUT    ANY  WARRANTY;  without   even   the  implied  warranty  of
### MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR   PURPOSE.  See the GNU
### General Public License for more details.
### 
### You should  have received a  copy of  the GNU  General Public  License
### along with   this  program; if   not,  write  to   the Free   Software
### Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
###


PRODUCT		= "@PRODUCT@"
VERSION		= "@VERSION@"


srcdir		= @srcdir@
VPATH		= @srcdir@

prefix		= @prefix@
termlib		= $(prefix)/lib
termlibgit	= $(prefix)/lib/git
termdir		= $(prefix)/lib/git/term

SHELL		= /bin/sh
INSTALL		= @INSTALL@
INSTALL_PROGRAM	= @INSTALL_PROGRAM@
INSTALL_DATA	= @INSTALL_DATA@
HOST		= @HOST@


GIT_TERMS	= .gitrc.thix .gitrc.linux .gitrc.vt100 .gitrc.vt102\
		  .gitrc.xterm .gitrc.hpterm .gitrc.ansi .gitrc.generic\
		  .gitrc.common .gitrc.minix .gitrc.aixterm .gitrc.hft

GIT_GENERICS	= .gitrc.sun .gitrc.sun-cmd

GIT_XTERMS	= .gitrc.xterms

GIT_HPTERMS	= .gitrc.hp

GIT_VT100S	= .gitrc.vt125 .gitrc.vt200 .gitrc.vt201 .gitrc.vt220\
		  .gitrc.vt240 .gitrc.vt300 .gitrc.vt320 .gitrc.vt400\
		  .gitrc.vt420

GIT_LINUXS	= .gitrc.console

all:

installdirs:
	$(srcdir)/../mkinstalldirs $(termlib) $(termlibgit) $(termdir)

install-strip: install

install: all install-only

install-only:
	for i in $(GIT_TERMS);\
	do\
	    $(INSTALL_DATA) $(srcdir)/$$i $(termdir)/$$i;\
	done
	\
	for i in $(GIT_XTERMS);\
	do\
	    rm -f $(termdir)/$$i;\
	    ln $(termdir)/.gitrc.xterm $(termdir)/$$i;\
	done
	\
	for i in $(GIT_HPTERMS);\
	do\
	    rm -f $(termdir)/$$i;\
	    ln $(termdir)/.gitrc.hpterm $(termdir)/$$i;\
	done
	\
	for i in $(GIT_GENERICS);\
	do\
	    rm -f $(termdir)/$$i;\
	    ln $(termdir)/.gitrc.generic $(termdir)/$$i;\
	done
	\
	for i in $(GIT_VT100S);\
	do\
	    rm -f $(termdir)/$$i;\
	    ln $(termdir)/.gitrc.vt100 $(termdir)/$$i;\
	done
	\
	for i in $(GIT_LINUXS);\
	do\
	    rm -f $(termdir)/$$i;\
	    ln $(termdir)/.gitrc.linux $(termdir)/$$i;\
	done

uninstall:
	-cd $(termdir) &&\
	rm -f $(GIT_TERMS) $(GIT_GENERICS) $(GIT_LINUXS)\
	      $(GIT_XTERMS) $(GIT_HPTERMS) $(GIT_VT100S)

clean:
	-rm -f *~ core* tutu* gogu*

mostlyclean: clean

distclean: clean
	-rm -f Makefile config.status config.log config.cache

realclean: distclean


# Tell version [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
